package cn.yinyu.queue.framework.common.util.exception;

import java.text.MessageFormat;

public class ExceptionUtils {

    public static String formatException(Exception e) {
        // 获取异常信息，记录日志
//        StackTraceElement stackTraceElement = e.getStackTrace()[0];
//        String className = stackTraceElement.getClassName();
//        String fileName = stackTraceElement.getFileName();
//        int lineNumber = stackTraceElement.getLineNumber();
//        String methodName = stackTraceElement.getMethodName();
//        return MessageFormat.format("类名:{0},文件名:{1},行数:{2},办法名:{3}", className, fileName, lineNumber, methodName);
        return e.getLocalizedMessage();
    }
}
